from PIL import Image
import numpy as np

from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True


im0 = Image.open("D:/Project/pabone/output22.bmp")
im0.show()

print(type(im0.palette))
print(im0.palette)
print(im0.info)
print(im0.mode)

im_rgb = im0.convert("RGB")
print(im_rgb.palette)
print(im_rgb.info)
print(im_rgb.mode)
im_rgb.show()

image_list = []

image_list.append(im0)

im1 = Image.open("C:/Users/chunshan.yang/Pictures/Screenshots/Screenshot (198).png")
im1.show()

image_list.append(im1)

image_list[0] = im1
print(len(image_list))

image_test = image_list[1]

# array = np.array(im1)
# print(type(array))

# print(type(im1))

# pixel = im1.load()
# print(type(pixel))

# print(im1.size)

# print(im1.mode)

# r_channel, g_channel, b_channel = im1.split()

# Image.new("L", (256, 3000), (0))


# im4 = Image.fromarray(array)
# im4 = Image.fromarray(array.astype('uint8'))


#Image.frombytes()
# im2 = Image.open("C:/Users/chunshan.yang/Pictures/Screenshots/Screenshot (200).png")
# im2.show()

# im3 = Image.blend(im1, im2, 0.5)
# im3.show()